<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQhMiniProgramComponentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qh_mini_program_components', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('名称(标识符)');
            $table->string('componentName')->comment('组件名');
            $table->text('data')->nullable()->comment('数据');
            $table->tinyInteger('status')->default(1)->comment('状态, 1：正常，2：禁用');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE qh_mini_program_components comment '小程序组件'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qh_mini_program_components');
    }
}
